﻿using MediatR;
using Traceability.Commont.Domains.AnimalsDomainFiles;
using Traceability.Commont.DTOs.CommontFiles;
using Traceability.Commont.Infrastructures.Interfaces;

namespace U.Enterprise.Api.Applications.AdmissionRegistrationFile
{
    public class ShopListHander:IRequestHandler<ShopListCommand,Resqults<Shopping>>
    {
        private readonly IBateRepository<Shopping> shop;

        public ShopListHander(IBateRepository<Shopping> shop)
        {
            this.shop = shop;
        }

        public async Task<Resqults<Shopping>> Handle(ShopListCommand request, CancellationToken cancellationToken)
        {
            try
            {
                Resqults<Shopping> res = new Resqults<Shopping>();
                res.Date = shop.GetAll().ToList();
                return res;
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
